package com.ishopping.service.manage.service.impl;

import com.ishopping.common.core.base.service.AbstractBaseService;
import com.ishopping.service.manage.mapper.RoleMapper;
import com.ishopping.api.manage.entity.Role;
import com.ishopping.api.manage.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("roleService")
public class RoleServiceImpl extends AbstractBaseService<Role> implements IRoleService {
	
	@Autowired
	private RoleMapper roleMapper;

	/**
	 * 通过用户id获取用户所具备的角色
	 * @param userId
	 * @return List<Role>
	 */
	@Override
	public List<Role> findRolesByUserId(Long userId) {
		return roleMapper.queryRolesByUserId(userId);
	}
}
